package com.linkage.bookshop.repository;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.linkage.bookshop.model.*;

@Repository
public interface UserRepository {
	public User selectUserSecurity(@Param("username") String username);
	public String selectUsername(@Param("username") String username);
	public String selectUsernameById(@Param("id") int id);
	public void insertUser(User user);
	public void insertUserAndRoleRelation(@Param("userId") int userId, @Param("roleId") int roleId);
	public String selectNickname(@Param("username") String username);
	public Integer selectUserId(@Param("username") String username);
	public Double selectWealth(@Param("username") String username);
	public void updateNickname(@Param("username") String username, @Param("nickname") String nickname);
	public String selectPassword(@Param("username") String username);
	public boolean updatePassword(@Param("username") String username,@Param("password") String password);
	public List<User> selectMembers(@Param("begin") int begin, @Param("numPerPage") int numPerPage);
	public void updateNonlocked(@Param("id") int id, @Param("target") boolean target);
	public User selectMember(@Param("username") String username);
	public List<User> selectAdmins(@Param("begin") int begin, @Param("numPerPage") int numPerPage);
	public User selectAdmin(@Param("username") String username);
	public int selectRoleId(@Param("name") String name);
	
}
